<script type="text/javascript">
	function bottomAlignChat() {
		var windowHeight = window.innerHeight;
		if( windowHeight > 0 ) {
			var contentElement = document.getElementsByTagName( "body" ).item( 0 );
			var contentHeight = contentElement.offsetHeight;
			if( windowHeight - contentHeight - 5 > 0 ) {
				contentElement.style.marginTop = ( windowHeight - contentHeight - 5 ) + 'px';
			} else {
				contentElement.style.marginTop = '4px';
			}
		}
	}

	document.body.addEventListener('DOMNodeInserted', bottomAlignChat);
	window.addEventListener('resize', bottomAlignChat);
	bottomAlignChat();
</script>
<div id="contents"></div>
